<!DOCTYPE html>
<html lang="en">
<#header />

<body>
    <div class="layui-fluid">
        <div class="layui-row" style="margin-top:30px;">
            <form id="deptForm" method="post" class="layui-form layui-form-pane" action="/dept/doAU.btl">
                <input type="hidden" lay-ignore name="id" value="${org.id!''}">
                <div class="layui-form-item">
                    <label class="layui-form-label">部门ID</label>
                    <div class="layui-input-block">
                        <input type="text" name="orgName" value="${org.orgName!''}" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
                    </div>
                </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">部门名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="orgDesc" value="${org.orgDesc!''}"  required  lay-verify="required" placeholder="输入初始密码" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="deptForm">立即提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <script>
        layui.use(["element","form","jquery","layer"],function(){
            var form = layui.form;
            var element = layui.element;
            var $ = layui.$;
            var layer =layui.layer;
            form.on('submit(deptForm)',function(data){
                $.post($("#userForm").attr("action"),$("#userForm").serialize(),function(data){
                    if(data=="success"){
                        layer.msg('保存成功', {
                            time: 0 //不自动关闭
                            ,btn: ['关闭本窗口', '取消']
                            ,yes: function(index){
                                layer.close(index);
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.layer.close(index);
                            }
                        });
                    }else if(data=="failed"){
                        lay.msg('保存失败');
                    }
                });
                return false;
            });
        });
    </script>
</body>
</html>